package com.zzj.controller;

import com.github.pagehelper.PageInfo;
import com.zzj.bean.FusionBean;
import com.zzj.service.FusionService;
import com.zzj.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Api
//@CrossOrigin
@RequestMapping("fusion")
public class FusionController {
    @Autowired
    private FusionService fusionService;

    @GetMapping("findAll")
    public PageInfo<FusionBean> findAll(
            @RequestParam(defaultValue = "1") int pageNum,
            @RequestParam(defaultValue = "5") int pageSize
    ){
        return fusionService.findAll(pageNum,pageSize);
    }

    @PostMapping("updateFusion")
    @ApiOperation("提交浇铸表")
    public Result updateModel(@RequestBody FusionBean fusionBean){
        System.out.println("fusionBean = " + fusionBean);
        return fusionService.updateFusion(fusionBean);
    }
}
